package com.pn.taikao.mapper;

import com.pn.taikao.entity.Class;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ClassMapper {
    int insert(Class clazz);

    int update(Class clazz);

    int deleteById(@Param("id") Long id);

    Class selectById(@Param("id") Long id);

    Class selectByName(@Param("name") String name);

    List<Class> selectByMajorId(@Param("majorId") Long majorId);

    List<Class> selectPage(@Param("name") String name,
                          @Param("majorId") Long majorId,
                          @Param("offset") int offset,
                          @Param("limit") int limit);

    long count(@Param("name") String name,
               @Param("majorId") Long majorId);
}